﻿<?php
    error_reporting(0);
 session_start();
 //数据库连接
 $conn=mysql_connect('localhost','root','root');
 mysql_select_db('itxmgl',$conn);
 //定义常量
 mysql_query('utf-8');
 define(ALL_PS,"PHP");
 
    $jsonData= json_encode($_POST); 
    $objData=json_decode($jsonData);
    $username=$objData->{'username'}; 
    $password=$objData->{'password'};
   $email=$objData->{'email'};
 $phoneCall=$objData->{'phoneCall'};

//写入数据
 
$password = md5($password.ALL_PS); 
$regdate = time(); 
$sql = "insert into r_customer(username,password,phoneCall,email)values
('$username','$password','$phoneCall','$email' )"; 

if(mysql_query($sql,$conn)){ 
  $tempArr = array('isRegSuccess'=>true);
        $backData = json_encode($tempArr); 
        echo $backData;
} else { 
$tempArr = array('isRegSuccess'=>false);
        $backData = json_encode($tempArr); 
        echo $backData; 
}

 




?>
